Ext.define('Admin.view.gooutapprove.GooutDeptLeaderApproveForm', {
    extend: 'Ext.form.Panel',
    alias: 'widget.gooutDeptLeaderApproveForm',
    requires: [
        'Ext.button.Button',
        'Ext.form.RadioGroup',
        //'Ext.form.field.Radio', 
        'Ext.form.field.*'

        //'Ext.form.field.File',
        //'Ext.form.field.Date',
        //'Ext.form.field.ComboBox',
        //'Ext.form.field.HtmlEditor'
    ],
    viewModel: {
        type: 'gooutApproveViewModel'
    },
    controller: 'gooutApproveViewController',
    bodyPadding: 10,
    bodyBorder: true,


    defaults: {
        anchor: '100%'
    },
    fieldDefaults: {
        labelAlign: 'left',
        msgTarget: 'none',
        invalidCls: '' //unset the invalidCls so individual fields do not get styled as invalid
    },

    items: [
    /*{
            xtype      : 'fieldcontainer',
            fieldLabel : 'Size',
            defaultType: 'radiofield',
            defaults: {
                flex: 1
            },
            layout: 'hbox',
            items: [{
                boxLabel  : 'M',
                name      : 'size',
                inputValue: 'm',
                id        : 'radio1'
            }, {
                boxLabel  : 'L',
                name      : 'size',
                inputValue: 'l',
                id        : 'radio2'
            }, {
                boxLabel  : 'XL',
                name      : 'size',
                inputValue: 'xl',
                id        : 'radio3'
            }]
        },*/
        {
            xtype: 'radiogroup',
            fieldLabel: '审批',
            defaults: {
                flex: 1
            },
            items: [{
                name: 'deptLeaderPass',
                inputValue: true,
                boxLabel: '同意',
                checked: true,
                listeners: {
                    "focus": function (el, checked) {
                        Ext.getCmp('gooutRefuseReason').setDisabled(true);

                    }
                }
		}, {
                name: 'deptLeaderPass',
                inputValue: false,
                boxLabel: '不同意',
                listeners: {
                    "focus": function (el, checked) {
                        Ext.getCmp('gooutRefuseReason').setDisabled(false);

                    }
                }
		}]
    }, {
            xtype: 'textareafield',
            grow: true,
            id: 'gooutRefuseReason',
            name: 'refuseReason',
            fieldLabel: '驳回理由',
            anchor: '100%',
        disabled: true
    }],

    bbar: [{
        xtype: 'button',
        ui: 'soft-blue',
        text: '提交',
        handler: 'onClickDeptLeaderApproveSubmitButton'
	}, {
        xtype: 'button',
        ui: 'gray',
        text: '取消',
        handler: function (btn) {
            var win = btn.up('window');
            if (win) {
                win.close();
            }
        }
	}]
});
